package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.Travel;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.query.StrategyTravelQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface TravelMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Travel record);

    Travel selectByPrimaryKey(Long id);

    List<Travel> selectAll();

    int updateByPrimaryKey(Travel record);

    List<Travel> selectForList(QueryObject qo);

    Travel selectByTravelId(Long id);

    Long  selectId();

    void changeState(Travel travel);

    Integer selectForLikeCount(Long travelId);//查询当前游记的点赞数量

    void updateForLikeCount(@Param("likeCount") Integer likeCount , @Param("travelId") Long travelId);//更新游记的点赞记录

    List<Travel> listTravelByStategyIdForApp(Long strategyId);
    void deleteRelation(@Param("strategyId") Long strategyId, @Param("travelId") Long travelId);

    void insertRelation(@Param("strategyId") Long strategyId,@Param("travelId") Long travelId);
    List<Map> listTravelCommentByStategyId(StrategyTravelQueryObject qo);
    List<Travel> selectRelease();


    Integer selectCollectCount(Long travelId);


    void updateCollectCount(@Param("collectCount") int collectCount, @Param("travelId") Long travelId);

    int selectForCount(Long authorId);

    void updateCommentCount(@Param("commentCount") int commentCount, @Param("travelId") Long travelId);

    List<Travel> selectForSearchList(QueryObject qo);
}